

class WeightedObject:

    # def __new__(cls, weight=None):
    #
    #     instance = super(WeightedObject, cls).__new__(cls)
    #     instance.__init__(weight)

    def __init__(self, weight=None):
        '''

        :param weight: initialed to be None,
        so that objects of subclasses must set this member, or relation comparisons like >, <, >=, etc,
        will not be allowed.
        '''
        self.weight = weight

    def __str__(self):
        return str(self.weight)



if __name__ == '__main__':

    w = WeightedObject(10)
    # w.weight = 10
    print(w)
